import java.util.ArrayList;
import java.util.List;

public class Solution119 {
    public List<Integer> getRow(int rowIndex) {
        List<Integer> res = new ArrayList<>();
        res.add(1);
        if (rowIndex == 0) {
            return res;
        }
        for (int i = 1; i < rowIndex / 2 + 1; i++) {
            long t = (long) res.get(i - 1) * (rowIndex - i + 1) / i;
            res.add((int) t);
        }
        for (int i = (rowIndex - 1) / 2; i >= 0; i--) {
            res.add(res.get(i));
        }
        return res;
    }
}
